package com.yh.service.impl;

import com.yh.mapper.ProductMapper;
import com.yh.pojo.Product;
import com.yh.service.ProductService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author by 张晨光
 * @date 2024/1/24 10:12
 */
@Service
public class ProductServiceImpl implements ProductService {
    @Resource
    ProductMapper productMapper;
    @Override
    public List<Product> findAll() {
        return productMapper.findAll();
    }

    @Override
    public void save(Product product) {
        productMapper.save(product);
    }

    @Override
    public Product findById(Integer id) {
        return productMapper.findById(id);
    }
    @Override
    public Product update(Product product){
        return   productMapper.update(product);
    }
    @Override
    public void delete(Integer id) {
        productMapper.delete(id);
    }
}
